package com.huilai.platform.country_platform.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * 作者：洪霓
 * 日期：2023/3/27
 * 注释：
 */
@Entity
@Table(name = "chat_message")
@EntityListeners(AuditingEntityListener.class)
@JsonIgnoreProperties(value = { "hibernateLazyInitializer"})
public class ChatMessage {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "message_id")
    private Integer id;

    @Column(name = "link_id")
    private Integer linkId;

    @Column(name = "from_id")
    private Integer fromId;

    @Column(name = "to_id")
    private Integer toId;

    @Column(name = "content")
    private String content;

    @Column(name = "send_time")
    private Date sendTime;

    @Column(name = "type")
    private Integer type;

    @Column(name = "is_lastest")
    private Integer isLastest;

    public ChatMessage(){}

    public ChatMessage(Integer linkId, Integer fromId, Integer toId, String content, Integer isLastest){
        this.linkId = linkId;
        this.fromId = fromId;
        this.toId = toId;
        this.content = content;
        this.isLastest = isLastest;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getLinkId() {
        return linkId;
    }

    public void setLinkId(Integer linkId) {
        this.linkId = linkId;
    }

    public Integer getFromId() {
        return fromId;
    }

    public void setFromId(Integer fromId) {
        this.fromId = fromId;
    }

    public Integer getToId() {
        return toId;
    }

    public void setToId(Integer toId) {
        this.toId = toId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getIsLastest() {
        return isLastest;
    }

    public void setIsLastest(Integer isLastest) {
        this.isLastest = isLastest;
    }
}
